﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy3_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double x = Convert.ToDouble(textBox1.Text);
            double y = Convert.ToDouble(textBox2.Text);
            double r = Convert.ToDouble(textBox3.Text);
            Circle circle = new Circle();
            circle.SetValue(x, y, r);
            textBox4.Text = circle.GetArea().ToString();
            textBox5.Text = circle.GetPerimeter().ToString();
            textBox6.Text = circle.GetDistance().ToString();

        }
    }
    public class Circle
    {
        private double x, y, r;
        public void SetValue(double x, double y, double r)
        {
            this.x = x;
            this.y = y;
            this.r = r;
        }
        public double GetArea()
        {
            return Math.Round(Math.PI * r * r, 2);
        }
        public double GetPerimeter()
        {
            return Math.Round(2 * Math.PI * r, 2);
        }
        public double GetDistance()
        {
            return Math.Round(Math.Sqrt(x * x + y * y), 2);
        }
    }
}
